package dominio;

public class Posicion {
	private Integer columna;
	private Integer fila;
	
	public Posicion() {
		this.columna = new Integer(0);
		this.fila = new Integer(0);
	}
	
	public Posicion(Integer fila, Integer columna) {
		this.fila = fila;
		this.columna = columna;
	}
	
	public Posicion(Posicion pos) {
		this.fila = pos.getFila();
		this.columna = pos.getColumna();
	}

	public Integer getColumna() {
		return columna;
	}

	public void setColumna(Integer columna) {
		this.columna = columna;
	}

	public Integer getFila() {
		return fila;
	}

	public void setFila(Integer fila) {
		this.fila = fila;
	}

	@Override
	public String toString() {
		return "Posicion Fila = " + this.getFila() + "; Columna = " + this.getColumna();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((columna == null) ? 0 : columna.hashCode());
		result = prime * result + ((fila == null) ? 0 : fila.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Posicion other = (Posicion) obj;
		if (columna == null) {
			if (other.columna != null)
				return false;
		} else if (!columna.equals(other.columna))
			return false;
		if (fila == null) {
			if (other.fila != null)
				return false;
		} else if (!fila.equals(other.fila))
			return false;
		return true;
	}
}
